package com.smartcommunity;

import com.alibaba.fastjson.parser.ParserConfig;
import com.smartcommunity.base.common.CacheMap;
import com.smartcommunity.utils.ApplicationContextHelper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * @ClassName: BaseServiceApplication
 * @Description: 基础服务启动主程序
 * @version V2.1.7
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableRedisHttpSession
@EnableCaching
@EnableAsync
@EnableScheduling
@EnableFeignClients(basePackages = "com.smartcommunity")
public class BaseServiceApplication {

	public static void main(String[] args) {
        SpringApplication.run(BaseServiceApplication.class, args);
        ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
        CacheMap cacheMap = (CacheMap) ApplicationContextHelper.getBean(CacheMap.class);
        cacheMap.initCache();

	}

}

